<template>
	<view class="container">
		<view class="row main">
			<view class="col goods-list">
				<view class="col goods-item" v-for="(item,index) in goodsList" v-bind:key="item">
					<view class="row goods-header">
						<!-- <image :src="item.goods_info.goods_naming.member_avatar" mode="aspectFill"></image> -->
						<image :src="item.goods_info.goods_naming.member_avatar?item.goods_info.goods_naming.member_avatar:url+'/static/imgs/user-color.png'" mode="aspectFill"></image>
						<view class="user-name">【{{item.goods_info.goods_naming.name}}】</view>
						<view class="goods-name">{{item.goods_info.name}}</view>
					</view>
					<view class="row goods-content">
						<image class="cover-image" :src="item.goods_info.image" mode="aspectFill"></image>
						
						<view class="col goods-content-main">
							<view class="description">
								<text v-if="item.goods_info.goods_naming.title">{{item.goods_info.goods_naming.title}}</text>
								<view v-else class="col status-none">
									<text>未冠名</text>
									<text>0.01元即可冠名。</text>
								</view>
							</view>
							<view class="row">
								<view class="price">¥{{item.goods_info.goods_price}}</view>
								<view class="row operate auto-left">
									<view class="month">{{item.month}}月</view>
									<view class="button" :class="item.to_user_status_name=='已发放'?'button-active':''">{{item.to_user_status_name}}</view>
								</view>
							</view>
						</view>
					</view>
				</view>
				<view class="row paginate" v-if="goodsList.length==0">
					<text>暂无送菜记录~</text>
				</view>
			</view>
		</view>

	</view>
</template>
<style>
	@import url("../../../../common/css/naming-goods-list.css");
</style>
<script>
	var app = getApp();
	import http from '../../../../common/js/request.js'

	export default {
		data() {
			return {
				store_id: app.globalData.storeId,
				url: app.globalData.baseImgUrl,
				goodsList: null
			}
		},
		onLoad() {
			this.getGoodsList();
		},
		methods: {
			getGoodsList() {
				var that = this;
				http.post('/api/v1/store/get_gifts_goods_list', {
					store_id: that.store_id,
				}, res => {
					that.goodsList = res.datas;
				});
			}
		}
	}
</script>
